package com.moore.mapper;

import com.moore.bean.Count;
import org.apache.ibatis.annotations.Select;

public interface CountMapper {

    @Select("SELECT \n" +
            "    (SELECT COUNT(*) FROM apartment) AS total_apartments,\n" +
            "    (SELECT COUNT(*) FROM tenantinfo WHERE status = '已租赁') AS rented_tenants,\n" +
            "    (SELECT COUNT(*) FROM tenantinfo WHERE status = '未审核') AS pending_tenants,\n" +
            "    (SELECT COUNT(*) FROM tenantinfo WHERE status NOT IN ('保存', '未审核')) AS other_tenants;")
    Count getCount();
}
